package org.lagou.edu.dao;

import org.lagou.edu.pojo.Product;
import org.springframework.stereotype.Repository;

@Repository
public class ProductDao {

    public Product getById(long id) throws Exception {
        return new Product(id, "商品" + id, (long)(Math.random()*1000));
    }

    public void insert(Product product) throws Exception {
        System.out.println("插入商品" + product);
    }

    public void deleteById(long id) throws Exception{
        System.out.println("删除商品" + id);
    }

    public void update(Product product) throws Exception {
        System.out.println("更新id为" + product.getId() + "的商品为" + product);
    }
}
